Automatic programming method and device

ABSTRACT

An automatic programming method includes a first processing including detecting a turning surface having a largest diameter in the product model, and determining a central axis of rotation on the turning surface detected as a turning axis of the product model; a second processing including shifting or rotating the product model so that the turning axis of the product model determined matches a turning axis of the work model; and a third processing including shifting the product model so that an end face of the product model shifted at the second processing matches a program origin preset in the work model, for automatically arranging the product model so as to be overlapped on the work model.

TECHNICAL FIELD

The present invention relates to an automatic programming method and anautomatic programming device for creating an NC creation program forcreating an NC program by CAD data of materials, product shapes, workshapes and the like. More specifically, the present invention relates toan automatic programming method and an automatic programming device thatcan simply execute position adjustment (superposition) processing of aproduct model and a work model, which is required at the time ofgenerating machining data as a difference between the product model andthe work model.

BACKGROUND ART

In a machine tool on which an NC unit (numerical control unit) ismounted, a work is machined into a desired product shape by executingthe NC program. To create the NC creation program for creating the NCmachining program, recently, an automatic programming technique using amicrocomputer referred to as an automatic programming device has beenfrequently used.

The early automatic programming devices were not connected to the CADdata, and hence, it was necessary to perform programming, while watchingthe machining shape in a drawing or the like. However, recently, sometechniques relating to the automatic programming device that creates theNC machining program by the CAD data have been proposed.

For example, in (Japanese Patent Application Laid-Open No. 2002-189510),feature data of a machined product is extracted from the CAD data to seta machining process and a machining area for each machining process,material data and a machining model for each machining process arecreated, the created machining process data and machining model data arestored, tool path data is created based on the machining process data,material data, machining model data, tool data, and cutting conditiondata, to create virtual work shape data after completing the respectiveprocesses, as well as creating fabrication information based on thecreated process data, material data, tool path data, and virtual workshape data.

In (Japanese Patent Application Laid-Open No. 2002-268718), when amachining path for machining a workpiece based on a three-dimensionalCAD data of a part is created, machining information for all portions tobe machined in a shape indicated by the three-dimensional CAD data isextracted, the extracted machining information is edited to determine amachining process, and the machining path is created based on thedetermined machining process.

In such type of automatic programming device, a product model isarranged in a work model, and machining data has to be created as adifference between the product model and the work model. At this time,it is desired that the product model can be automatically arrangedeasily in the work model.

In (Japanese Patent Application Laid-Open No. 2001-117616), it isdisclosed that an object solid model (product model) and a workpiecesolid model (work model) are overlapped on each other and combined, toobtain a synthesis model indicating a capacity portion of a workpiece,which has to be removed in order to form the object. Specifically, ahuman user selects at least one of topological feature types, selects asurface of the synthesis model, associates a related one portion of themodel having the selected surface with the selected topological featuretype, defines the portion having the selected surface as a machiningfeature topologically equivalent to the selected topological featuretype, and divides the capacity portion to be removed into many machiningfeatures.

In the conventional art described in Japanese Patent ApplicationLaid-Open No. 2001-117616, however, how to overlap the object solidmodel (product model) and the workpiece solid model (work model) is notparticularly described.

The present invention has been achieved in order to solve the aboveproblems, and it is therefore an object of the invention to provide anautomatic programming method and device that can position the productmodel on the work model with quite simple operation, and can achieveefficient programming operations.

DISCLOSURE OF THE INVENTION

An automatic programming method according to the present invention,which is for positioning a product model in a work model, anddetermining a machining area based on a state of positioning the productmodel, includes a first processing including detecting a turning surfacehaving a largest diameter in the product model, and determining acentral axis of rotation on the turning surface detected as a turningaxis of the product model; a second processing including shifting orrotating the product model so that the turning axis of the product modeldetermined matches a turning axis of the work model; and a thirdprocessing including shifting the product model so that an end face ofthe product model shifted at the second processing matches a programorigin preset in the work model.

According to the present invention, since a machining plane having thelargest diameter in the product model is used to automatically arrangethe product model so as to be overlapped on the work model, time andlabor for an operator to manually calculate the position of the productmodel with respect to the work model can be saved, thereby enablingefficient programming operations.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a configuration of an automatic programmingdevice;

FIG. 2 is a block diagram of an NC unit having the automatic programmingdevice built therein;

FIG. 3 is a flowchart of an operation procedure of an automaticprogramming device according to a first embodiment of the presentinvention;

FIG. 4 is a schematic for illustrating an example of a menu selectionmain screen;

FIG. 5 is a schematic for illustrating an example of an extension menuof the menu selection main screen;

FIG. 6 is a schematic for illustrating an example of a productshape-reading screen;

FIG. 7 is a schematic for illustrating an example of a workshape-setting screen;

FIG, 8 is a table of an example of stored data in work type database;

FIG. 9 is a schematic for illustrating a relation between end-facemachining and end-face machining allowance set value;

FIG. 10 is a flowchart of an automatic selection processing procedure ofa round bar work model;

FIG, 11 is a schematic for illustrating an automatic-selectionprocessing procedure shown in FIG. 10;

FIG. 12 is a flowchart of the automatic selection processing procedureof a hexagonal bar work model;

FIG. 13 is a schematic for illustrating the automatic-selectionprocessing procedure shown in FIG. 12;

FIG. 14 is a schematic for illustrating an example of the workshape-setting screen for explaining another selecting processingprocedure of the work model;

FIG. 15 is a flowchart of another automatic selection processingprocedure of the work model;

FIG. 16 is a schematic for illustrating another example of a workshape-forming dialog;

FIG. 17 is a schematic for illustrating a display mode in a materialinput column;

FIG. 18 is a schematic for illustrating a shift of focus between a datainput column and a list box of material database;

FIG. 19 is a flowchart of an operation procedure of a partial materialsetting mode;

FIG. 20 is a schematic for illustrating an example of a partial materialsetting screen;

FIG. 21 is a perspective view for illustrating a partial materialsetting processing;

FIG. 22 is a schematic for illustrating the partial material settingprocessing;

FIG. 23 is a schematic for illustrating an example of a product modelbefore the partial material setting processing;

FIG. 24 is a partially enlarged view of the product model shown in FIG.23;

FIG. 25 is a schematic for illustrating a model after the partialmaterial setting processing of the product model shown in FIG. 24;

FIG. 26 is a schematic for illustrating an example of a fixture settingmenu;

FIG. 27 is a flowchart of an operation procedure of a fixture (jig)setting processing;

FIG. 28 is a schematic for illustrating an example of types of thematerial end-face shape and a claw pattern selection table;

FIG. 29 is a schematic for illustrating an example of a fixture settingwindow;

FIG. 30 is a flowchart of a procedure of a grasping diametercalculation;

FIG. 31 is a schematic for illustrating a concept of a holding diametercalculation;

FIG. 32 is a flowchart of an automatic position adjustment processing ofthe product model and the work model;

FIG. 33 is a schematic for illustrating a display content of aregistration screen for performing the automatic position adjustmentprocessing of the product model and the work model;

FIGS. 34A to 34E are schematics for illustrating a machining surface anda machining diameter;

FIG. 35 is a schematic for illustrating a Z reversal processing;

FIG. 36 is a schematic for illustrating a shape shift menu;

FIG. 37 is a schematic for illustrating depicts a shape shift dialog;

FIG. 38 is a flowchart of a process dividing processing;

FIG. 39 is a schematic for illustrating a screen in which acharacteristic is displayed;

FIG. 40 is a schematic for illustrating a ½ section of a model in whicha process dividing spot is specified;

FIG. 41 is a flowchart of another example of the automatic processingfor dividing the process;

FIGS. 42A to 42D are schematics for illustrating the concept of theautomatic processing for dividing the process shown in FIG. 41;

FIG. 43 is a schematic for illustrating the fixture setting processingin a second process;

FIGS. 44A and 44B are schematics for illustrating an automaticdetermination processing of a through hole and two holes;

FIG. 45 is a schematic for illustrating an example of machining processexpansion for an inner diameter portion;

FIG. 46 is a schematic for illustrating point machining of an areabetween claws of a chuck;

FIG. 47 is a flowchart of tool selection processing;

FIG. 48 is a schematic for illustrating an edit processing with respectto a non-expandable shape;

FIG. 49 is a schematic for illustrating a program editing screen;

FIG. 50 is a flowchart of highlighting processing in a three-dimensionaldisplay unit of a machining unit;

FIGS. 51A and 51B are schematics for illustrating a processing forinserting the shape selected by the three-dimensional display unit intoa cursor position in an editor unit as a shape sequence;

FIG. 52 is a flowchart of shape sequence insertion processing;

FIG. 53 is a schematic for illustrating a state in which the shapesequence is inserted into the editor unit;

FIG. 54 is a schematic for illustrating the program editing screen;

FIG. 55 is a flowchart of unit insertion processing;

FIG. 56 is a block diagram of a configuration of an automaticprogramming device according to a second embodiment of the presentinvention; and

FIG. 57 is a flowchart of an operation procedure of the automaticprogramming device according to the second embodiment.

BEST MODE FOR CARRYING OUT THE INVENTION

Exemplary embodiments of an automatic programming method and anautomatic programming device according to the present invention areexplained in detail below with reference to the accompanying drawings.

FIRST EMBODIMENT

FIG. 1 is a block diagram of a configuration of an automatic programmingdevice according to a first embodiment of the present invention. Anautomatic programming device 100 includes, as a basic component, NCcreating software for directly fetching data relating to a product shapeand a work shape from CAD data, and creating an NC creation program formachining a product from a material (work) in an interactive mode withan operator, by various data such as the fetched product shape data andwork shape data. The automatic programming device is installed in acomputer such as a microcomputer. The NC creation program is describedin a predetermined language higher than the NC program.

The automatic programming device 100 can be applied to a two-spindlemachine tool having two spindles, that is, a main spindle andsubstrate-spindle, and a one-spindle machine tool having only the mainspindle. However, the automatic programming device applied to thetwo-spindle machine tool having twp spindles, the main spindle and thesubstrate-spindle, will be explained in the first embodiment. Theautomatic programming device applicable to both the two-spindle machinetool and the one-spindle machine tool will be explained in the secondembodiment.

The automatic programming device 100 is applicable to the machine toolthat performs turning for rotating a work and shaving it in a roundshape, boring for rotating the work and boring therein, milling forfixing the work and rotating an edged tool to shave the work, andsurface machining. The automatic programming device 100 is alsoapplicable to combined machining in which turning and milling arecombined.

FIG. 1 shows a state in which the automatic programming device 100 isinstalled in a computer, and the automatic programming device 100 isconnected to an NC unit 200 that is operated by an NC program via acommunication interface 23.

In FIG. 1, a product shape database 1, a work type database 2, and atool database 3 are registered in a built-in memory or an externalmemory of the microcomputer in which the automatic programming device100 is installed. Pieces of product shape data shown inthree-dimensional CAD data (three-dimensional solid model data) areregistered and stored in the product shape database 1. Various types ofdata, such as the material, shape (columnar, square, hexagonal and thelike), and size (outer diameter, inner diameter, length, and the like)are registered and stored in the work type database 2, for each work.Tool data is registered and stored in the tool database 3.

The microcomputer, in which the automatic programming device isinstalled, includes a display apparatus 20, an input unit 21 such as akeyboard and a mouse, and an output unit 22 such as a printer, and themicrocomputer is connected to external equipment such as the NC unit 200via the communication interface 23.

A program unit, which is the basic component of the automaticprogramming device 100, includes a product shape input processor 10, awork shape input processor 11, a jig setting processor 12, a positionadjustment processor 13, a process division processor 14, a processexpansion processor 15, a tool selection processor 16, anon-expandable-shape editing processor 17, a program editing processor18, and a program expansion processor 19.

The product shape input processor 10 displays a product shape inputscreen for selecting the product shape data (product model) by anoperator, and when the operator selects the necessary product shape datafrom a plurality of product shape data formed of the product shapedatabase 1 or three-dimensional solid model data stored in anotheroptional memory, the product shape input processor 10 executesprocessing such as three-dimensionally displaying the selected productshape data.

The work shape input processor 11 displays a work shape input screen forselecting the work shape data (work model) by the operator, allows thenecessary work shape data to be selected automatically or by theoperator from the work shape data formed of the product shape database 1or the three-dimensional solid model data stored in another optionalmemory, and executes processing such as three-dimensionally displayingthe selected work shape data. The work shape input processor 11 has apartial work setting function for creating thickened work data used forcasting and the like based on the product shape data.

The jig setting processor 12 displays jig models formed of a chuck and aclaw, and work models, prepares a plurality of jig arrangement patternscorresponding to the work shapes, determines the jig arrangement byallowing the operator to select a jig arrangement pattern, andcalculates a holding position and a holding diameter, to transmit theinformation to the NC side.

The position adjustment processor 13 performs processing forautomatically arranging the product model in the work model held by afirst chuck at a first process (step performed by the main spindle). Theposition adjustment processor 13 also performs processing forautomatically arranging the product model in the work model held by asecond chuck at a second process (step performed by a sub-spindle).

The process division processor 14 performs process dividing processingat the time of machining by the two-spindle machine tool having twospindles, the main spindle and the sub-spindle, and process dividingprocessing at the time of machining by the one-spindle machine toolhaving only the main spindle. In the case of the two-spindle machinetool, the dividing position between the first process performed by themain spindle and the second process performed by the sub-spindle isspecified by an outer diameter and an inner diameter. In the case of theone-spindle machine tool, the dividing position of the first process forperforming machining by holding one end of a work model by the mainspindle, and the second process for performing machining by holding theother end of the work model by the main spindle, is specified by anouter diameter and an inner diameter, respectively.

The process expansion processor 15 executes processing for breaking downa series of machining operations including turning, point machining,surface machining, and chamfering, referred to as machining modes, intomachining units in which continuous machining is performed with the samemain spindle and the same tool.

The tool selection processor 16 performs tool determination processingfor selecting an optimum tool for each processing position (machiningunit) from the tool database 3, and also determines cutting conditioncorresponding to the tool.

The program expansion processor 19 creates an NC creation programdescribed by the predetermined language based on a combination of aplurality of process-expanded machining units, the determined toolinformation, and the cutting condition.

The non-expandable-shape editing processor 17 performs editing work forconverting the non-expandable shape, which cannot be automaticallyexpanded into the machining unit in the process expansion processing, tosome machining unit. The program editing processor 18 is for performingthe editing processing of the created NC creation program.

The automatic programming device 100 is connected to the NC unit 200 viathe communication interface 23 in FIG. 1, however as shown in FIG. 2,the automatic programming device 100 can be installed into the NC unit200. In this case, the automatic programming device 100 is connected toan NC controller 201 in the NC unit 200.

FIG. 3 is a flowchart of a creation procedure of the NC creation program(machining program) executed by the automatic programming device 100shown in FIGS. 1 and 2. The details of the creation procedure of the NCcreation program executed by the automatic programming device will beexplained for each process, with reference to FIG. 3.

A menu selection main screen 8 displayed first when activating theautomatic programming device 100 will be explained. FIG. 4 is aschematic for illustrating an example of the menu selection main screen8.

As shown in FIG. 4, the menu selection main screen 8 includes a treedisplay unit 4, a 3D display unit 5, a menu display unit 6, and thelike. A name of a product file, a name of a work file, a jig (fixture)file, file names of respective machining units expanded to the machiningunits, and the like are tree-displayed on the tree display unit 4. Theshape data of the product file, work file, jig file, or machining unitfile selected on the tree display unit 4 are three-dimensionally (3D)displayed on the 3D display unit 5.

The menu display unit 6 includes a product shape set button 6 a, a workshape set button 6 b, a fixture set button 6 c, a position adjustmentbutton 6 d, a process division button 6 e, a unit expansion button 6 f,a unit edit button 6 g, a Program create button 6 h, and the like. Theproduct shape set button 6 a is a button for shifting to a product shapesetting mode, wherein processing such as reading a 3D-CAD model of theproduct shape is executed. The work shape set button 6 b is a button forshifting to a work shape setting mode, wherein the work shape to bemachined is selected and set. The fixture set button 6 c is a button forshifting to a fixture setting mode, wherein a fixture (chuck, claw) forholding the work is set. The position adjustment button 6 d is a buttonfor shifting to a registration mode, wherein position adjustment of theproduct and the work is executed. The process division button 6 e is abutton for shifting to a process dividing mode, wherein a dividingposition of the first process and the second process is set. The unitexpansion button (process expansion button) 6 f is a button for shiftingto a unit expanding mode, wherein automatic expansion of the machiningunit is executed from the set information. The unit edit button 6 g is abutton for shifting to a unit editing mode, wherein editing of theexpanded machining unit is executed. The program creation button 6 h isa button for shifting to a program creating mode, wherein the NCcreation program is created from the expanded and edited unit.

The menu display unit 6 includes a menu changeover button 6 k. Anotherdisplay menu shown in FIG. 5 is changed over and displayed on the menudisplay unit 6 by operating the menu changeover button 6 k. A sectiondisplay button 7 a is a button for section-displaying the display dataof the 3D display unit 5, and a section display angle set button 7 b isa button for executing section display at a specified angle. A scalingbutton 7 c, a rotation button 7 d, and a shift button 7 e are buttonsfor scaling, rotating, and shifting the display data on the 3D displayunit 5. A fitting button 7 f is a button for displaying the displayed 3Dshape so that the whole shape is fitted in the middle of the screen,with the posture thereof unchanged. A dimension line display-changeoverbutton 7 g is a button for displaying or non-displaying a dimension linewith respect to the displayed 3D shape. A front button 7 h, a backbutton 7 i, a left side button 7 j, a right side button 7 k, a planebutton 7 l, and a bottom button 7 m are buttons for performing frontdisplay, back display, left side display, right side display, planedisplay, and bottom display of the displayed 3D shape. A first spindle3D display button 7 n is a button for displaying the displayed 3D shapein a direction as seen toward the first spindle, and a second spindle 3Ddisplay button 7 p is a button for displaying the displayed 3D shape ina direction as seen toward the second spindle.

In the automatic programming device, each process is normally executedaccording to the procedure shown in FIG. 3, after displaying the menuselection main screen 8. That is, respective steps are executed in orderof product shape input processing (step S100), work type settingprocessing (step S101), first process jig setting processing (stepS102), position adjustment (step S103), process dividing processing(step S104), second process jig setting processing (step S105), positionadjustment processing (step S106), process expansion processing (stepS107), tool automatic setting processing (step S108), program expansionprocessing (step S109), non-expandable shape editing processing (stepS110), and program edit processing (step S111). The respectiveprocessing will be explained in detail for each step.

(1) Input of Product Shape (Step S100)

The product shape input processing is started by turning ON the productshape set button 6 a of the menu selection main screen 8 shown in FIG.4. When the product shape set button 6 a on the menu selection mainscreen 8 shown in FIG. 4 is turned ON, the screen is changed over to theproduct shape read screen 30 for the product shape input processingshown in FIG. 6. The product shape input processing is mainly executedby a product shape input processor 10 in FIG. 1.

An operator operates an input unit 21, with the product shape readscreen 30 for selecting the product shape data being displayed, toselect three-dimensional CAD data (product model) corresponding to theproduct in the following manner.

First, the operator presses a product shape read button 31 positioned onthe leftmost side of a plurality of buttons arranged below the productshape read screen 30. As a result, a product shape-reading dialog 32 isdisplayed on the left side and a three-dimensional view 33 fordisplaying the product shape (product model) corresponding to theselected three-dimensional CAD data in a wire frame format is displayedon the right side.

The product shape-reading dialog 32 has a list box 34 for displaying alist of CAD files registered in the product shape database 1. When theoperator has selected an optional file in the list box 34, a preview ofthe product shape corresponding to the selected file is displayed on thethree-dimensional view 33. In the preview, respective dimensions of theproduct in the X, Y, and Z directions are displayed on thethree-dimensional view 33. Respective three-dimensional CAD data hasshape information and color information (display color), and attributedata relating to the machining is added to the respective pieces ofshape information. The attribute data includes screw, coarseness signs,grinding off, chamfering, chamfering of holes, hole information (drill,reamer, end mill, boring, and tapping), part number, material, names ofarticles, and the like. Adjustment (change of machining order) of theprocess expansion result is executed by the attribute data. The CAD dataincludes the color information (display color), and the roughness of thefinished surface can be identified according to the display color.

The current directory is displayed on a directory display unit 35positioned above the list box 34 of the file list. The file list in thedirectory displayed on the directory display unit 35 is displayed in thelist box 34. When the operator presses a folder change button 36, afolder-changing dialog (not shown) is displayed, and the currentdirectory can be changed by operating the dialog.

When the operator presses a selection button 37, the CAD file selectedin the list box 34 is read into a storage area of the automaticprogramming device, an image of the product corresponding to the readCAD file is created, and the created product shape (product model) isdisplayed on the three-dimensional view 33. At the time of display,respective dimensions of the product model in the X, Y, and Z directionsare displayed on the three-dimensional view 33. Furthermore, anautomatic adjustment mode at the time of creating the image of theproduct shape is included, and if the operator selects YES in item 29 inthis automatic adjustment mode, the direction of the product and thedisplay position of the product are automatically adjusted on thethree-dimensional view 33.

One or more directories are provided inside or outside the computer asan area for the product shape database 1, so that an optionalthree-dimensional CAD data can be newly registered in these directories,or already registered product shape data can be changed andre-registered.

(2) Setting of Work Shape (Step S101)

The work type setting processing is started by turning ON the work shapeset button 6 b on the menu selection main screen 8 shown in FIG. 4, andwhen the work shape set button 6 b is turned ON, for example, the screenis changed over to a work shape setting screen shown in FIG. 7. The worktype setting processing is mainly executed by the work shape inputprocessor 11 in FIG. 1.

FIG, 8 is a table of an example of the work shape data registered in thework type database 2. The work shape data includes, as shown in FIG. 8,materials, types of the shape (columnar, square, hexagonal and thelike), size (outer diameter, inner diameter, length, and the like), andthe like.

A work setting menu 9 a is displayed on a work shape setting screen 9shown in FIG. 7. The work setting menu 9 a includes a work databasebutton 9 b, a partial work set button 9 c, a work model read button 9 d,a work material set button 9 e, an edit button 9 f, and a machiningallowance change button 9 g.

The material database button 9 b is a button for performing automaticselection of the work, described below. The partial work set button 9 cis a button for creating a work model in which a product model used forcasting or the like is partially thickened. The work model read button 9d is a button for reading work data registered in the work type database2 or optional work data stored in an external storage unit to set thework data as a work shape. The work material set button 9 e is a buttonfor manually setting the material. The edit button 9 f is a button forregistering necessary work data in the work type database 2 or editingthe registered work data. The machining allowance change button 9 g is abutton for changing the set value for a machining allowance of an endface.

When the operator presses the work database button 9 b, a work databasedialog 300 is displayed. The dimensions of the maximum outer diameter ofthe product shape in the X, Y, and Z directions, determined by theproduct shape input processing executed at step S100 are displayed in aproduct shape dimension display section 301 in the work database dialog300.

The work shape data registered in the work type database 2 islisted/displayed in a work list display section 302 in the work databasedialog 300. A work having a minimum diameter including the outerdiameter of the product is selected from the listed/displayed work shapedata, and the selected work is highlighted as shown by reference sign303. In this case, a round bar is selected by the operator as the workshape, the work shape data of the round-bar work is listed/displayed,and the work having the minimum diameter including the outer diameter ofthe product is selected from the round-bar work data, highlighted anddisplayed. When the work type is not specified, a work having theminimum diameter including the outer diameter of the product is selectedfrom all work shape data, such as round-bar work, square work, andhexagonal work, registered in the work type database 2.

When the operator does not like the automatically selected andhighlight-displayed work data, the operator appropriately performssorting by items of number, work material, work type, outer diameter,inner diameter, and length, to select a desired work data. When theoperator presses an OK key 304, in a state with the desired work databeing selected (the selected work data is highlight-displayed), thehighlighted work data is selected, and an end-face machining allowancedialog 305 is opened.

In the end-face machining allowance dialog 305, work number, workmaterial, work type, outer diameter, inner diameter, length, andend-face machining allowance of the selected work are displayed, and inthe initial state, the machining allowance is 0 millimeter.

The set value of the end-face machining allowance is a set value forend-face machining for cutting off the work end at the beginning ofturning. That is, since the work end of an unmachined work is not cutoff smoothly, end-face machining is executed at the beginning ofturning. When the operator inputs a desired value as a set value of theend-face machining allowance, and presses the OK button, an end-facemachining program for removing the set end-face machining allowance byturning is created at the time of creating the machining program.

FIG. 9 is a schematic for illustrating a concept of the end faceprocessing. A work model WM is overlapped on a product model SM in FIG.9. In FIG. 9, an end-face machining allowance TM1 is a value set by theend-face machining allowance dialog 305, and an end-face machiningallowance TM2 on the other side is a value obtained by subtracting theproduct length and TM1 from the work length.

FIG. 10 is a flowchart of a procedure in work automatic selectionprocessing when the work database button 9 b is pressed, and in thiscase, is a procedure when the round bar is specified as the work type.

Respective distances from a program origin Pc (preset in the productshape input processing) of the product model determined in the productshape input processing executed at step S100 to the fringe area of theproduct model in a direction perpendicular to a turning axis (Z axis) ofthe product model is calculated, to select the maximum distance Lmaxfrom a plurality of calculated distances (step S120). That is, as shownin FIG. 11, distances from the program origin Pc to a plurality ofpoints PW1 to PWi on the fringe area of the product model SM in adirection perpendicular to the turning axis are respectively determinedto select the maximum distance Lmax from the distances. In FIG. 11, apivot (Z axis) extends in a direction perpendicular to the page.

A plurality of round bar data registered in the work type database 2 islisted/displayed in the work list display section 302 in the workdatabase dialog 300, and a round-bar work whose radius equal to orlarger than Lmax and having a minimum diameter is selected from thelisted/displayed round bar data (step S121).

When the selected round-bar work is only one (step S122), the work datacorresponding to the selected round-bar work is highlighted anddisplayed in the work list display section 302 (step S124). However,when there is a plurality of selected round bar data, a round-bar workhaving a length equal to or longer than the product model and shortestamong the round-bar works (step S123). The work data corresponding tothe selected one or more round-bar works are highlighted and displayedin the work list display section 302 (step S124).

A procedure in the work automatic selection processing when a hexagonalbar is selected as the work type will be explained with reference toFIGS. 12 and 13. In this case, as shown in FIG. 13, the posture of theproduct model SM with respect to the hexagonal-bar work model WM isdetermined, so that the program origin Pc of the product model SMmatches the center Po of one hexagonal-bar work model WM (step S130).Also in this case, the pivot extends in a direction perpendicular to thepage.

The respective sides of the hexagonal-bar work model WM are shifted inparallel until the sides touch the product model SM, to determinedistances L1 to L6 between the parallel-shifted respective line segmentsLa1 to La6 and the program origin Pc of the product model SM in thedirection perpendicular to the turning axis. The longest distance Lmaxis then obtained from these distances (step S131).

Pieces of hexagonal bar data registered in the work type database 2 arelisted/displayed in the work list display section 302 in the work datadialog 300, to select a hexagonal-bar work having an opposite sidelength (a distance between opposite sides) equal to or larger than 2Lmax and the shortest opposite side length, from the listed/displayedhexagonal bar data (step S132).

When the selected hexagonal-bar work is only one (step S133), the workdata corresponding to the selected hexagonal-bar work is highlighted anddisplayed in the work list display section 302 (step S135). However,when there is a plurality of selected hexagonal bar data, ahexagonal-bar work having a length equal to or longer than the productmodel and shortest among the hexagonal-bar works (step S134). The workdata corresponding to the selected one or more hexagonal-bar works arehighlighted and displayed in the work list display section 302 (stepS135).

In the case of FIG. 7, all data registered in the work type database 2is listed/displayed in the work list display section 302, and one ormore minimum work data involving the product model ishighlight-displayed from the listed/displayed data, but as shown in FIG.14, only the works involving the product model can be listed/displayedin the work list display section 302, from all data registered in thework list display section 302. When there is a plurality of worksinvolving the product model, a work having the smallest diameter and thesmallest length, that is, the one whose chipped amount at the time ofmachining is small is highlight-displayed at the uppermost position inthe work list display section 302, and hereunder, the display sequenceis sorted out in order of from the one whose chipped amount is smallfrom the upper position. By performing the display in this manner, theoperator can easily select a work contributing to cost reduction, with afewer chipped amount at the time of machining.

Another embodiment of the work model input setting processing will beexplained with reference to FIGS. 15 to 18. The work type setting screenshown in FIGS. 16 to 18 does not operate synchronized with the worktypesetting screen 9 shown in FIG. 7, and the work type setting screenshown in FIGS. 16 to 18 and the work type setting screen 9 shown in FIG.7 are screens of a so-called separate version.

When the work data is registered in the work type database 2, uponpressing an appropriate button (not shown) (corresponding to the editbutton 9 f on the work type setting screen 9 shown in FIG. 7), a workdata registration screen (not shown) is displayed. The operatorappropriately operates the work data registration screen, to registerrequired work data as shown in FIG. 8 in the work type database 2.Three-dimensional CAD data can be also input in the work type database 2as work data.

On the other hand, when the work data is manually selected from the worktype database 2, the operator presses an appropriate button(corresponding to the work model read button shown in FIG. 7). When thisbutton is pressed, a work type creating dialog 40 shown in FIG. 16 isdisplayed.

The work type creating dialog 40 has a data input column 41 forinputting the work material, work type, outer diameter of the work,inner diameter of the work, length, and end-face machining allowance, alist box 42 in which data registered in the work type database 2 islisted/displayed, and a product size display column 43 in which the XYZdimensions of the product shape are displayed.

A work material input column 44 and a work type input column 45 in thedata input column 41 are formed of a combo box, and the operator selectsthe necessary one from the list in the combo box for the work materialand the work type (round bar, square bar, and the like). An outerdiameter input column 46, an inner diameter input column 47, a lengthinput column 48, and an end-face machining allowance input column 49 areformed of an edit box, and a required figure is directly input to eachcolumn.

When the operator selects a required material and a work type in thework material input column 44 and the work type input column 45, thework type input processor 11 searches the work type database 2, usingthe selected material and work type as a keyword, to extract the workdata matching the selected material and work type, of many work data inthe work type database 2, and listed/displayed the extracted work datain the list box 42.

The operator selects the required work data from the list box 42, andfor example, when the operator presses an input (enter) key on akeyboard, which is an input unit 21, the respective data in the outerdiameter input column 46, the inner diameter input column 47, and thelength input column 48 are automatically updated by the outer diameter,the inner diameter, and the length of the selected work data. When theoperator selects a work having a length 0 and presses an input key, thelength of the work is not changed.

The respective operation above can be performed by a pointer such as amouse, but the following short cut key function can be provided. Thatis, when focus is in the work material input column 44 and the work typeinput column 45, and for example, when a cursor shift key “↑” or “↓” ispressed, as shown in FIG. 17, the combo boxes in the work material inputcolumn 44 and the work type input column 45 are opened, and the list isdisplayed. Furthermore, while the lists in the combo boxes in the workmaterial input column 44 and the work type input column 45 are opened,for example, if the input key is pressed, as shown in FIG. 17, the listis closed. Even when focus is not in the combo box, the list is closedlikewise. For example, when a TAB key is pressed, focus is shifted amongthe work material input column 44, the work type input column 45, theouter diameter input column 46, the inner diameter input column 47, thelength input column 48, and the end-face machining allowance inputcolumn 49. Furthermore, when focus is in any of the work material inputcolumn 44, the work type input column 45, the outer diameter inputcolumn 46, the inner diameter input column 47, the length input column48, and the end-face machining allowance input column 49, if a cursorshift key “→” is pressed, as shown in FIG. 8, focus is shifted to thelist box 42 in the work database. When the focus is to be returned tothe original position from the list box 42 in the work database, acursor shift key “←” is pressed.

Thus, the operator inputs appropriately desired data in the data inputcolumn 41 in the work type creating dialog 40, so that the operator canmanually set desired work data.

After finishing data input setting to the data input column 41, when theoperator presses a creation button 58, the input-set work data is readinto a storage area of the automatic programming device from the worktype database 2, to create an image of a work corresponding to the readwork data, and the created work type is displayed on thethree-dimensional view (not shown).

In the manual setting by the operator as described above, it is notassured that the optimum smallest work that can be machined into aproduct shape can be selected. Therefore, in the product size displaycolumn 43 in the work type creating dialog 40, a product shapereflecting button 50 is provided for automatically selecting the optimumsmallest work that can be machined into the product shape selected bythe operator. In the product size display column 43, the XYZ dimensionsof the product shape set in the product shape input processing at stepS100 are displayed.

The automatic selection processing of a work model based on pressing ofthe product shape reflecting button 50 will be explained with referenceto FIG. 15. First, data is input to the work material input column 44and the work type input column 45, to select the work material and thework type. Furthermore, dimension data of the product shape is input(step S140). In the case of the automatic programming device, since theselection processing of the product shape is finished at this point intime, the dimensions of the input product shape are displayed in theproduct size display column 43.

In this state, when the product shape reflecting button 50 is pressed(step S141), the work type input processor 11 searches the work typedatabase 2, using the material and work type selected in the workmaterial input column 44 and the work type input column 45 as a keyword,to extract the work data matching the selected material and work type,of many work data in the work type database 2 (step S142). The work typeinput processor 11 selects a work involving the product shape, that is,having a larger size than that of the product, from one or moreextracted works extracted by comparing the dimension data of theextracted one or more works and the dimension data of the product, andfurther selects a work having the minimum size from one or more workscapable of involving the product shape (step S143). As a method ofselecting the work having the minimum size, the method explained withreference to FIGS. 10 and 12 is used.

When the work selection processing is finished, the work type inputprocessor 11 updates the respective data in the outer diameter inputcolumn 46, the inner diameter input column 47, the length input column48, and the end-face machining allowance input column 49 with the valuesof the finally selected work data. Thus, the optimum smallest workcapable of machining the product shape is automatically selected. A workmodel is created based on the selected work data.

Since the smallest work data involving the product shape isautomatically selected from the work database, the time and labor of theoperator to manually select the work data can be saved, thereby enablingefficient programming operations.

A partial work setting mode executed by pressing the partial work setbutton 9 c on the work type setting screen 9 shown in FIG. 7 will beexplained with reference to FIGS. 19 to 25. In this partial work settingmode, a product model is displayed at the time of selecting the work, toallow the operator to select and specify the portion to be thickened andthe thickness of this portion from the displayed product model, so thata model in which only the selected and specified portion is thickened tohave the specified thickness is created, and the created model isregistered as the work model.

In other words, in casting and molding material machining, products areoften manufactured by creating a work having a shape close to thedesired product, and adding machining such as turning to the createdwork. The product manufacturer side asks a work manufacturer to supplysuch a work having a shape close to the desired product. On the otherhand, in the automatic programming device, a machining path and an NCcreation program cannot be prepared, unless the product model and thework model are defined. Therefore, it is necessary to define the workmodel when performing casting and molding material machining. In thepartial work-setting mode (thickening mode), a work model for thecasting and molding material machining can be easily created.

The operation procedure in the partial work-setting mode will beexplained with reference to the flowchart shown in FIG. 19.

When the partial work set button 9 c on the work type setting-screen 9shown in FIG. 7 is pressed, a partial work setting dialog 51 as shown inFIG. 20 and a product model 3D display screen as shown in FIG. 21 areopened. The 3D-displayed product model is a product model selected inthe product shape input processing at step S100. Normally, in the CADdata of the product model, a color attribute different for each surfaceis added, and each surface of the 3D displayed product model isdisplayed with a color corresponding to the set color attribute, asshown in FIG. 21. In this case, in the product model shown in FIG. 21,green color attribute is set to the surfaces D1 and D3, and red colorattribute is set to the surfaces D2 and D4.

In FIG. 20, the partial work setting dialog 51 has a color selectionsection 51 a, a machining allowance setting section 51 b, and an OKbutton 51 c, and in the color selection section 51 a, all colors set asthe attribute for the product model are extracted and displayed. Forexample, the number of colors that can be set as the attribute is256×256×256. When the product model is expressed by 20 colors amongthese colors, the 20 colors are displayed in the color selection section51 a. In the product model shown in FIG. 21, if only the colorattributes of green (D1, D3) and red (D2, D4) are set, only the twocolors, green and red are displayed in the color selection section 51 a.

The operator selects the color corresponding to the portion, which theoperator wants to thicken, from the colors displayed in the colorselection section 51 a, to specify the necessary surface of the productmodel (step S150), and sets the thickness of the portion to be thickenedin the machining allowance setting section 51 b (step S151). When theoperator presses the OK button 51 c, only the surface corresponding tothe selected color of the product model displayed on the 3D displayscreen is thickened by the machining allowance set in the machiningallowance setting section 51 b (step S152).

In the color selection section 51 a, when there is another selectedsurface, the processing of from steps S150 to S152 is repeatedsimilarly.

FIG. 22 is the product model shown in FIG. 21 in cross section (sideface). When green is selected in the color selection section 51 a, 10millimeters is set in the machining allowance setting section 51 b, andthe OK button 51 c is pressed, as shown in FIG. 22, the surfaces D1 andD3 having the green attribute are thickened by 10 millimeters.Furthermore, when green is selected in the color selection section 51 a,5 millimeters is set in the machining allowance setting section 51 b,and the OK button 51 c is pressed, as shown in FIG. 22, the surfaces D2and D4 having the red attribute are thickened by 5 millimeters.

When all surface selection is finished, it is determined whether thereare adjacent surfaces between the thickened surfaces (step S154). Whenthere are no adjacent thickened surfaces, the thickened model created by(repetition of) the processing of from steps S150 to S152 is registeredand set as the work model (step S157).

On the other hand, when there are adjacent thickened surfaces, a dialog(not shown) for selecting either a curved surface (shown by solid lineE1 in FIG. 22) such as ellipse or circle, or a rectangular surface(shown by broken line E2 in FIG. 22) as a connecting surface between theadjacent surfaces is displayed, so that the operator selects the curvedsurface or the rectangular surface as the connecting surface. Theconnecting surface can be selected for each adjacent portion, or can becommonly selected as the curved surface or the rectangular surface forall adjacent portions. The adjacent thickened portions are thenconnected as shown in FIG. 22, by the selected connecting surface (stepS156). The thickened model is registered and set as the work model (stepS157).

FIG. 23 is one example of a part of the product model 3D-displayed atthe time of partial work setting mode. An enlarged view of part F inFIG. 23 is shown in FIG. 24. A thickened model in which thickenedportions G1 to G4 are added is shown in FIG. 25.

In the above example, the color attribute is adopted as the displayattribute for specifying the respective surfaces of the product model,so as to select the surface to be thickened by the color attribute setfor the product model. However, various types of filling patterns suchas hatching can be set as the display attribute for the respectivesurfaces of the product model, and a desired surface to be thickened canbe selected by selecting these filling patterns. Furthermore, thesurface to be thickened can be selected by an operation of an input unitsuch as a mouse, and a machining allowance can be set with respect tothe selected surfaces.

In the partial work setting processing, a desired thickened model iscreated by specifying the surface to be thickened, of the respectivesurfaces of the product model, and the thickness of the specifiedsurface to be thickened, so that the created thickened model can beregistered as the work model. As a result, a work model to be used incasting or the like can be easily created.

(3) First Process Jig Setting Processing (Setting of First Chuck andClaw, Step S102)

The jig setting processing (fixture setting processing) is started byturning on the fixture set button 6 c on the menu selection main screen8 shown in FIG. 4. When the fixture set button 6 c is turned on, fixturesetting is started, and for example, the menu is changed over to afixture setting menu 52 as shown in FIG. 26, and a claw patternselection table 53 shown in FIG. 28 and a fixture setting window 54shown in FIG. 29 are displayed. The fixture setting processing is mainlyexecuted by the jig setting processor 12 in FIG. 1. The first processjig setting processing is for setting the jig at the first processcarried out by the main spindle of the two-spindle machine tool.

A jig model is formed of chuck models and claw models for holding thework. For the chuck shape data, in the case of the configuration of FIG.1, NC parameters (outer and inner diameters and width of the chuck) areobtained from the NC unit 200 via the communication interface 23 oroffline, and in the case of the configuration of FIG. 2, NC parameters(outer and inner diameters and width of the chuck) are obtained from theNC controller 201, and the outer and inner diameters and the width ofthe chuck are displayed by the obtained NC parameters, so that theoperator selects a desired chuck shape. For the claw, the number, theshape, the size, and the holding diameter of the claw are determinedaccording to the procedure shown in FIG. 27. The procedure shown in FIG.27 is executed by the jig setting processor 12.

In the fixture setting menu 52 shown in FIG. 26, an outer claw selectionbutton 52 a is a button for selecting an outer claw, an inner clawselection button 52 b is a button for selecting an inner claw, and thesehave exclusive relation, such that when one of these is selected, theother is in a non-selection state. A holding diameter/claw numberchanging button 52 c is a button for changing the holding diameter andthe number of claws. A first spindle claw set button 52 d is a buttonfor setting the claw of the first spindle (main spindle), and a secondspindle claw set button 52 e is a button for setting the claw of thesecond spindle (sub-spindle). When the fixture setting menu 52 isinitially displayed, the outer claw selection button 52 a and the firstspindle claw set button 52 d are automatically selected and turned on. Aclaw edit button 52 f is a button used at the time of editing the clawdata. A fixture setting finish button 52 g is a button for finishing thefixture setting processing.

In this case, since it is jig setting for the first process, the firstspindle claw set button 52 d is turned on, and either one of the outerclaw selection button 52 a and the inner claw selection button 52 b isturned on.

When these buttons are turned on, the jig setting processor 12 obtainsthe type (circular, square, hexagonal, and the like) of the end face ofthe work and the dimension data of the work model, from the work modeldetermined in the work type setting processing at step S101 (step S160).

For the claw pattern displayed in the claw pattern selection table 53shown in FIG. 28 (claw model pattern), at first, the claw pattern islargely divided into an outer claw pattern and an inner claw pattern,and then classified by type of (circular, square, hexagonal, and thelike) of the end face of the work, claw arrangement pattern (the numberof claws, the holding portions by the claw (holding a corner, holding aflat surface, and the like). In FIG. 28, only the outer claw patternsare shown.

Not all claw patterns are displayed in the claw pattern selection table53, and only claw patterns corresponding to the type of the work endface of the work model, of claw patterns corresponding to the selectedone of the outer claw selection button 52 a and the inner claw selectionbutton 52 b, are displayed. For example, when a work model in a shape ofquadratic prism is set, only three claw patterns in the middle row ofthe claw patterns shown in FIG. 28 are shown (step S161). The operatorselects and specifies a desired claw pattern from the claw patternsdisplayed here (step S162). As a result, the number of claws and theholding portion by the claw (holding a corner or holding a flat surface)are specified.

When the claw pattern is selected, registered data of one or more clawmodels corresponding to the selected claw pattern is extracted from thewhole registered data, and the extracted registered data is displayed ina list display section 54 a in the fixture setting window 54 shown inFIG. 29 (step S163). For example, when a claw pattern of a type ofsquare, four claws, and holding a flat surface is selected, only theregistered data of the claw model corresponding to the selected patternis displayed in the list display section 54 a.

The list display section 54 a includes a claw number display section(claw number) in which a claw number of a registered claw model isdisplayed, a claw name display section in which the name of a registeredclaw shape (claw model) is displayed, a claw height display section inwhich the height of the registered claw shape is displayed, a clawlength display section in which the length of the registered claw shapeis displayed, a claw width display section in which the width of theregistered claw shape is displayed, a Z-direction chucking allowancedisplay section in which the chucking allowance in the Z direction ofthe registered claw shape is displayed, and an X-direction chuckingallowance display section in which the chucking allowance in the Xdirection of the registered claw shape is displayed. That is, in thelist display section 54 a, the shape data of the selected claw model isdisplayed for each claw number.

The fixture setting window 54 further includes a claw shape displaysection 54 b in which whether the claw is an outer claw or an inner clawis identified and displayed, a holding diameter display section 54 c inwhich the holding diameter is displayed, a selected claw number displaysection 54 d in which the selected claw number is displayed, a clawnumber display section 54 e in which the number of claws of the selectedclaw pattern is displayed, and a fixture display section 54 f in whichthe selected chuck model, the selected claw model, and the selected workmodel are displayed in cross section or three-dimensionally displayed.

When the operator selects desired data from the registered data (clawmodel) of the claw displayed in the list display section 54 a (stepS164), the jig setting processor 12 displays the selected claw number inthe selected claw number display section 54 d, and displays the numberof claws in the claw number display section 54 e, and calculates aholding position coordinates and a holding diameter of the clawaccording to the procedure shown in FIG. 30.

That is, as shown in FIG. 31, the jig setting processor 12 shifts a clawmodel TM so that the selected claw model TM abuts against the end faceof the work model WM determined in the work type setting processing(step S170), and calculates the holding position coordinates, that is,the holding diameter for the claw model TM to hold the work model WM,based on the shape data of the claw model, the holding position patternof the claw model (whether holding a corner or holding a flat surface),and the shape data of the work model (outer diameter, inner diameter,length, length of end face) (step S171). At the time of shift, in thecase of the outer claw, the claw model TM is shifted so as to abutagainst the outer diameter of the end face of the work model WM, and inthe case of the inner claw, the claw model TM is shifted so as to abutagainst the inner diameter of the end face of the work model WM.

In this manner, when it is determined at which position at the end ofthe work model the claw model is held, that is, when calculation of theholding position (holding diameter) of the claw is finished, the jigsetting processor 12 displays the calculated holding diameter value inthe holding diameter display section 54 c, and displays the chuck model,the claw model, and the work model in the fixture display section 54 f,in a state with the claw model holding the work model (step S165).

Thus, the work model is arranged in the first jig model (in this case, afirst chuck and claw). When the shape data, the number of claws, and theholding diameter of the selected claw model are to be changed, theoperator presses the claw edit button 52 f, or the holding diameter/clawnumber changing button 52 c to open the edit dialog, and executes theedit processing by the edit dialog.

In this manner, since some jig arrangement patterns are preparedcorresponding to the work types, and the operator selects a jigarrangement pattern to determine the jig arrangement, the jigarrangement becomes easy. Furthermore, since the holding position andthe holding diameter of the claw are calculated on the work model, ifthe calculation result is transmitted to the NC side, interference checkbetween the tool and the jig (claw) on the NC side can be performedefficiently.

(4) Position Adjustment (Step S103)

The position adjustment processing is started by turning on the positionadjustment button 6 d on the menu selection main screen 8 shown in FIG.4. This position adjustment processing is mainly executed by theposition adjustment processor 13 in FIG. 1. In this position adjustmentprocessing, the product model is automatically arranged (superposed) inthe work model held by the first chuck model, and a different portionbetween the superposed work model and the product model is set as amachining area, and the machining area is expanded to various types ofmachining units in the subsequent process expansion, processing.

First, as shown in (a) of FIG. 33, the product model SM and the workmodel WM created in the previous processing are displayed on a positionadjustment screen 55. The work model WM is displayed in a state arrangedat a position set at step S102 with respect to a first jig (in thiscase, the first chuck and claw) model ZG.

At this time, the work model WM held by the first jig model ZG isarranged at a predetermined position on the position adjustment screen55, but the product model SM is arranged at a position corresponding tothe coordinate of the CAD data with respect to the origin of the CADdata. Therefore, when the product model SM and the work model WM areinitially displayed, the positions of the product model SM and the workmodel WM normally do not match each other.

In this state, when the operator presses the automatic adjustment button(not shown) arranged in the lower part of the position adjustment screen55, the position adjustment processor 13 executes the positionadjustment processing as shown in FIG. 32.

At first, the position adjustment processor 13 detects a machiningsurface having the largest diameter among one or more surfaces to bemachined present in the product model SM, and determines a central axisof rotation of the detected machining surface having the largestdiameter as a Z′ axis (turning axis) (step S180).

The machining surface is a surface, as shown in FIGS. 34A to 34D, havingany one of a surface of a column 310, a surface of a cone 311, a surfaceof a torus 312, and a surface of a sphere 313, centering on an axis. Asshown in FIG. 34E, when a part of the machining surface is missing, adistance from the central axis of rotation to the farthest point isdesignated as a diameter of the machining surface.

The product model SM is then rotated and parallel-shifted so that the Z′axis determined from the product model SM matches the Z axis (turningaxis) of the work model WM held by the first jig model ZG (step S181).Furthermore, the product model SM is parallel-shifted so that the endface of the product model SM in the Z′ axis direction matches theprogram origin O (Z=0) of the automatic programming device (step S182).

The program origin O is preset at a position at the center of the workmodel WM in the X-axis direction and at a predetermined distance fromthe end face of the work model WM in the Z-axis direction, away from thefirst jig model, so that the product model SM is included in the workmodel WM, when the end face of the product model SM in the Z′ directionis arranged so as to match the program origin O (Z=0). As a result, asshown in (b) of FIG. 33, the product model SM is arranged at amachinable position in the work model WM. The position of the programorigin O can be changed.

However, at the time of rotation and parallel shift of the product modelSM at step S181, it is not clear which one of the two end faces of theproduct model SM in the Z direction is arranged on the side close to theprogram origin O (on the right side in (b) of FIG. 33). Therefore, whenthe operator checks the direction in the Z direction of the productmodel obtained by automatic arrangement and judges that it is better torotate the product model SM in the Z direction by 180 degrees becausethe chipped allowance is less or the like, the operator presses aZ-reversal button (not shown) arranged on a position adjustment screen55. The central axis for rotation by 180 degrees is an axis 57 (see FIG.35) extending in parallel with the X axis from the central position ofthe product model SM in the Z-axis direction. Therefore, as shown inFIG. 35, the product model SM is rotated about the axis 57 by 180degrees, and the direction thereof in the Z direction is reversed (stepS183). Even if the product model SM is rotated, the central position ofthe product model does not change.

This position adjustment function includes a manual adjustment functionfor adjusting the arrangement of the product model SM by the operator.In this manual adjustment function, the direction of the product modelSM can be selected, and the product model SM can be rotated or shiftedin the X-, Y-, and Z-axis directions. The manual adjustment function isused when the operator judges that the chipped amount can be reduced bymanual adjustment.

While the position adjustment screen 55 is displayed, when the operatorpresses a shape shift key 56 (not shown) arranged on the lower part ofthe position adjustment screen 55, a shape shift menu as shown in FIG.36 is displayed.

The shape shift menu includes parallel shift button in the X-, Y-, andZ-axis directions, a rotation button in the X-, Y-, and Z-axisdirections, and a shape shift finish button. When any button is pressed,a shape shift dialog for performing the shift or rotation of the shapeas shown in FIG. 37 is displayed, and the pressed button isreverse-displayed.

As shown in FIG. 37, the shape shift dialog includes a shape selectioncheck box 60 for selecting an object of shape shift from product shape(product model), work shape (work model), first chuck shape (first chuckmodel), and second chuck shape (second chuck model), a step amount inputsection 61, a shift amount input section 62, and a shift button 63.

In the shape selection check box 60, the shape (model) with a check isparallel-shifted or rotated. When the operator inputs a shift amount ofthe model in the shift amount input section 62, and presses the shiftbutton 63 or the input key, the parallel shift or rotation of the modelis executed. When the shift amount is specified in the shift amountinput section 62 to shift the model, the model is shifted by thespecified amount once.

When the operator inputs a step amount (unit shift amount) of the modelin the step amount input section 61, and presses the shift button 63 orthe input key, the parallel shift or rotation of the model is executed.When the operator inputs the step amount in the step amount inputsection 61, and presses the cursor shift key “↑” or “↓”, while the focusis on the step amount input section 61, the shape shift is executed. Inthe shape shift by inputting the step amount, a preview of the shape tobe shifted is displayed, and the displayed preview is shifted. When theoperator presses the cursor shift key “↑”, the shape is parallel-shiftedin the “+” direction or rotated, and when the operator presses thecursor shift key “↓”, the shape is parallel-shifted in the “−” directionor rotated. When the operator presses the shift button 63 or the inputkey, the shift of the preview by inputting the step amount is reflectedon the shape, to complete the shape shift. Thus, when the model isstep-shifted by specifying the step amount in the step amount inputsection 61, the model is shifted by the specified step amount, everytime the cursor shift key “↑” or “↓” is pressed.

In the above explanation, adjustment of the Z axis between the productmodel and the work model and positioning of the end face of the productmodel in the Z-axis direction at the program origin are performed by oneshape shift button, but the adjustment of the Z axis between the productmodel and the work model can be performed by one button, and positioningof the end face of the product model in the Z-axis direction at theprogram origin can be performed by another button.

Since the product model is automatically arranged so as to be overlappedin the work model held by the jig model, the time and labor of theoperator to manually calculate the position of the product model withrespect to the work model can be saved, thereby enabling efficientprogramming operations.

(5) Process Dividing (Step S104)

The process dividing processing is started by turning on the processdivision button 6 e on the menu selection main screen 8 shown in FIG. 4.The process dividing processing is executed by the process divisionprocessor 14 in FIG. 1. The process dividing processing in this case isfor dealing with machining by a two-spindle machine tool having the mainspindle and a sub-spindle, and respectively specifying the dividingposition between the first process in which a machining area as adifference between the product model and the work model is machined bythe main spindle, and the second process in which the machining area ismachined by the sub-spindle, by the outer diameter and the innerdiameter. In the two-spindle machine tool, the work is held and machinedby the main spindle in the first process, and after the work is held bythe sub-spindle, the work is machined by the sub-spindle in the secondprocess.

The process dividing processing will be explained according to FIG. 38.On a process dividing processing screen (not shown), at first, theoperator selects whether the process division is performed manually orautomatically (step S150). When the operator selects a manual mode, theprocess division processor 14 extracts characteristic points at whichthe shape of the product model SM, such as a vertex, a hole, and a ridgechanges on the outer diameter side and the inner diameter side,respectively (step S191). The process division processor 14 displays theextracted respective characteristic points on the outer diameter sideand the inner diameter side on the screen as candidates of processdivision (step S192).

FIG. 39 is one example of a process dividing screen on which a pluralityof characteristic points is displayed. Characteristic points 320 andcandidates 321 for process division corresponding to the characteristicpoints are displayed for the outer diameter side and the inner diameterside. The candidate lines 321 for process division are lines extendingin a direction perpendicular to the Z axis. When there is nocharacteristic point, a position calculated by adding a predeterminedmargin to the chucking allowance of the claw in the first process isdisplayed on the screen as a candidate for process division, so thatmachining is executed as much as possible in the first process in whichmore stable machining can be performed.

The operator refers to these displayed candidates for process divisionto select and specify desired process dividing spot for the innerdiameter and the outer diameter (step S193). The process divisionprocessor 14 calculates a coordinate position on the product model SM atthe selected and specified process dividing spot (step S194). Thus, theprocess dividing position is determined (step S156).

FIG. 40 is a schematic for illustrating a ½ section of a model in whichthe process dividing spot is specified. In FIG. 17, a product model SMpositioned with respect to the work model WM is shown, and in this case,the shape of the product model SM is assumed to be symmetric withrespect to the Z axis. In this product model SM, it is necessary toperform milling at 6 positions (3 positions on one side), in addition todrilling (a hole in the middle) and turning (outer diameter portion andinner diameter portion). In this case, it is determined that the outerdiameter side is divided into the first process and the second processat the process dividing position 65, and the inner diameter side isdivided into the first process and the second process at the processdividing position 66.

A milling position 67 located on the first process side belongs to thefirst process, and a milling position 69 located on the second processside belongs to the second process. The process division processor 14determines the machining content such that at a milling position 68 inwhich the process dividing position 65 is present, the whole portionincluding the one belonging to the first process side is machined in thesecond process. This is because it is more efficient to perform millingafter chipping the whole outer diameter, than performing milling in astate that the outer diameter is chipped to half.

On the other hand, when the automatic determination mode is selected atstep S190, the process division processor 14 executes the followingprocessing. That is, the chucking allowance length La of the claw in thefirst process is calculated, and a length (La+α) is calculated by addinga predetermined margin α to the chucking allowance length La of the claw(step S195), to determine a position of the work model WM away from theend face in the Z direction on the chuck side for the length (La+α), asthe process dividing position (step S196). A region on the edge sidefrom the determined dividing position is designated as a first processregion to be machined in the first process, and a region on the baseside (chuck side) from the dividing position is designated as a secondprocess region to be machined in the second process. A plurality ofdifferent values is preset corresponding to the length in the Zdirection of the product model or the work model as the margin α, sothat the margin α is changed corresponding to the length in the Zdirection of the product model or the work model.

Another example of the automatic determination processing for processdivision will be explained with reference to FIGS. 41 and 42A to 42D.

FIG. 42A is the product model SM positioned on the work model WM. Whenthe operator selects the automatic determination mode for processdivision, the process division processor 14 obtains a work model inwhich the machining areas on the front side and the backside, which areto be removed in the end-face processing from the work model WM, aredeleted (step S200). FIG. 42B is the concept thereof, in which amachining area Q1 on the front side and a machining area Q2 on thebackside are removed from the work model WM. That is, the machining areaQ1 on the front side and the machining area Q2 on the backsidecorrespond to the end-face machining allowance explained with referenceto FIG. 9, and these machining areas Q1 and Q2 are removed based on theend-face machining allowance set by the end-face machining allowancedialog 305 shown in FIG. 7.

As shown in FIG. 42C, the process division processor 14 divides theturning area in the work model into a turning area on the outer diameterside and a turning area on the inner diameter side, based on the shapedata of the work model from which the end-face machining allowance isremoved, and the shape data of the product model, to obtain a volume Vaof the divided turning area on the outer diameter side and a volume Vbof the turning area on the inner diameter side (step S201).

As shown in FIG. 42D, the process division processor 14 designates aposition in the Z direction, at which the volume Va of the turning areaon the outer diameter side is divided into two, that is, a position inthe Z direction, at which the volume Va1 of a turning area on the outerdiameter side in the first process and the volume Va2 of a turning areaon the outer diameter side in the second process become the same, as aprocess dividing position 65 on the outer diameter side. Likewise, theprocess division processor 14 designates a position in the Z direction,at which the volume Vb of the turning area on the inner diameter side isdivided into two, that is, a position in the Z direction, at which thevolume Vb1 of a turning area on the inner diameter side in the firstprocess and the volume Vb2 of a turning area on the inner diameter sidein the second process become the same, as a process dividing position 66on the inner diameter side (step S202).

Thus, since the process is automatically divided into the first processand the second process, the time and labor of the operator to divide theprocess manually can be saved, thereby enabling efficient programmingoperations.

In the case of FIGS. 42A to 42D, the position in the Z direction, atwhich the turning area on the outer diameter side is divided into two isdesignated as a process dividing position on the outer diameter side,and the position in the Z direction, at which the turning area on theinner diameter side is divided into two is designated as a processdividing position on the inner diameter side. However, a position in theZ direction, at which the whole machining area on the outer diameterside including turning and milling is divided into two can be designatedas a process dividing position on the outer diameter side, and aposition in the Z direction, at which the whole machining area on theinner diameter side is divided into two can be designated as a processdividing position on the inner diameter side.

Furthermore, a position at which the volume of the whole machining areaincluding the end-face machining area is divided into two can bedesignated as the process dividing position. In this case, the processdividing position on the inner diameter side and the outer diameter sidebecome the same position.

In the case of FIGS. 42A to 42D, only a turning area is extracted fromthe whole machining area, to obtain the Z position at which theextracted turning area is divided into two. Therefore, the turning areais separated from other machining areas in the whole machining areabeforehand, based on the shape data or the like of the machining area.The details of this separation are described in Japanese PatentApplication Laid-Open No. 2003-241809 filed by the present applicant.

(3)′ Second Process Jig Setting (Setting of Second Chuck and Claw, StepS105)

The second process jig setting is mainly executed by the jig settingprocessor 12 in FIG. 1. The second process jig setting processing is forsetting a jig used in the second process, performed by the sub-spindlein the two-spindle machine tool.

In the second process jig setting processing, the operator turns on thefixture setting button 6 c on the menu selection main screen 8 shown inFIG. 4, to open the fixture setting menu 52 shown in FIG. 26, andfurther presses the second spindle claw set button 52 e so as to displaythe claw pattern selection table 53 shown in FIG. 28 and the fixturesetting window shown in FIG. 29, to perform the same processing asdescribed above, thereby setting the claw arrangement of the secondchuck on the sub-spindle side.

However, at the time of fitting the work to the sub-spindle, the firstprocess has already been completed, and the holding diameter of the clawin the second process is determined by assuming the work shape afterfinishing machining in the first process. That is, as shown in FIG. 43,a work model WM′ after machining in the first process has been completedis created by the shape data of the product model SM, and the processingsimilar to the first process jig setting processing explained for stepS102 is performed, to calculate the holding diameter of the claw.

(4)′ Position Adjustment (Step S106)

The position adjustment processing is mainly executed by the positionadjustment processor 13 in FIG. 1. The position adjustment processing isprocessing for automatically arranging the product model in the workmodel held by the second chuck used in the second process. Since theoperation thereof is the same as the position adjustment processingexplained for step S103, the explanation is omitted.

(6) Process Expansion (Step S107)

The process expansion processing is started by turning on the unitexpansion button 6 f on the menu selection main screen 8 shown in FIG.4. The process expansion processing is mainly executed by the processexpansion processor 15 in FIG. 1.

The process expansion processing is for breaking down a series ofmachining operation including turning, point machining, surfacemachining, chamfering and the like, referred to as machining modes, intomachining units in which continuous machining is performed with the samemain spindle and the same tool. The machining operation is formed as acombination of a plurality of machining units. In the process expansionprocessing, the machining operation both in the first process and thesecond process is expanded into a unit of machining units.

It is assumed that the default of the sequence in the automatic processexpansion in the case of combined machining is turning→surfacemachining→point machining→chamfering, and this sequence can beoptionally set by the operator. A rule for process-expanding only thepoint machining can be set by omitting turning, surface machining, andchamfering, in order to deal with machining for performing only holedrilling.

The default of the sequence in respective machining in the turning isend-face machining→turning drill (central hole)→machining of outerdiameter of a bar→machining of inner diameter of the bar, and thissequence can be al optionally set by the operator. Therefore, even asequence of end-face machining→machining of outer diameter of abar→turning drill→machining of inner diameter of the bar is possible,and a sequence of end-face machining→turning drill→machining of innerdiameter of the bar→machining of outer diameter of the bar is alsopossible.

The surface machining is process-expanded in order of from the onehaving a shallow machining depth. In the case of cylindrical shape, orcylindrical shape+conic shape, the point machining is expanded todrilling, and in the case of two cylindrical shapes having differentdiameters+conic shape, the point machining is expanded to a washer facedhead. When machining attribute data is added to the CAD data, expansionto tapping, reaming, boring, and perfect circle is possible. The pointmachining is classified into four shape sequences of point, row, square,and lattice according to the array of holes having the same diameter,and the efficiency of point machining is improved by performing drillingin the sequence determined by the classified respective shape sequences.Furthermore, the diameter of the hole is compared with a threshold, todetermine whether to perform point machining or pocket milling based onthe comparison result, and either the point machining or pocket millingis executed according to the determination result. In this case, thethreshold of the diameter can be optionally set.

In point machining, it is automatically determined whether each hole isa through hole that can be machined by one point machining as shown inFIG. 44A, or two holes that can be machined only by two-point-machiningas shown in FIG. 44B, and point machining is expanded according to thedetermination result.

FIG. 45 is one example of process expansion of turning only for theinner diameter portion. Reference sign 70 denotes a ½ cross section ofthe product model. In this case, an area 71 is first machined by turningand drilling, and the inner diameter of an area 72 is machined byturning. In the second process, the inner diameter of an area 73 ismachined by turning. These respective areas 71, 72, and 73 arerespectively one machining unit.

As shown in (a) of FIG. 46, when a portion 75 to be point-machined ispresent in the lower part of the turning area 74 in an area between theclaws of the first chuck, as shown in (b) of FIG. 46, the hole shape ofthe portion 75 to be point-machined is extended to the surface of thework model, and the point machining of the portion 75 to bepoint-machined, with the hole shape being extended, is performed in thefirst process, in which more stable machining can be normally performedthan in the second process. The turning work with respect to the turningarea 74 is performed in the second process.

The details of the process expansion processing are described inJapanese Patent Application Laid-Open No. 2003-241809 filed by thepresent applicant.

(7) Tool Selection (Step S108)

The process expansion processing described below is mainly executed bythe tool selection processor 16 in FIG. 1. FIG. 47 is an automaticexpansion procedure of the tool sequence.

At first, a finishing allowance expansion for determining a finishingallowance corresponding to a finish mark in the CAD data is performed(step S210). Tool type expansion for determining how many tools are tobe used for machining the respective process-expanded portions to bemachined is then performed (step S211). Tool determination processingfor selecting an optimum tool for the respective portions to be machinedfrom the tool database is performed next (step S212). Lastly, since thetools are determined, a cutting condition corresponding to the tool isdetermined (step S213).

(8) Program Expansion (Step S109)

The program expansion processing is started by turning on the programcreate button 6 h on the menu selection main screen 8 shown in FIG. 4.The program expansion processing is mainly executed by the programexpansion processor 19 in FIG. 1.

In the program expansion processing, NC creation programs for the firstand the second processes made of a predetermined language are created,based on the combination of the process-expanded machining units, thedetermined tool information, and the cutting condition. The NC creationprograms are converted to NC programs as numerical programs on the NCunit 200 side or the second NC controller 201 side in FIG. 1.

(9) Non-expandable Shape Editing (Step S110)

The non-expandable shape editing processing is mainly executed by thenon-expandable-shape editing processor 17 in FIG. 1. The non-expandableshape editing processing is for performing editing work for converting anon-expandable shape that cannot be automatically expanded to themachining unit in the previous process expansion processing into somemachining unit.

The non-expandable shape includes a curved face, a shape requiringmachining by a special tool, a shape that is not included in themachining units in the NC creation program created by the automaticprogramming device, a tapered portion of a tapered pocket and the upperpart thereof, an R portion and a fillet portion of a bottom R and apocket with bottom fillet, and the upper part thereof.

The non-expandable shapes that cannot be automatically expanded to themachining unit are displayed, as shown in (a) of FIG. 48, asnon-expandable shapes 81 and 82 in a machining shape tree 80, whichhierarchically displays the machining units on a tree.

In the machining shape tree 80, editing operation such as a change ofthe machining unit name, a sequence change of machining units, andswitching of valid/invalid of the machining unit can be performed. InFIG. 48, “outer diameter of bar”, “pocket mill”, and “non-expandableshape” are added as the machining unit names, and the figure added onthe left of the machining unit name shows the machining order of themachining units. When the order of the machining units is changed,interference due to the order change is checked.

The non-expandable shape can be expanded, as shown in (b) of FIG. 48, tothe NC creation program that can be created by the automatic programmingdevice, by changing the machining unit name, for example, from“non-expandable” to “pocket mill”, and specifying the shape sequence(how to specify the shape expressing the profile) and the tool.

(10) Program Editing (Step S111)

The program edit processing is started by turning on the unit editbutton 6 g on the menu selection main screen 8 shown in FIG. 4. Theprogram edit processing is mainly executed by the program editingprocessor 18 in FIG. 1. In this program edit processing, edit processingof the created NC creation program is performed. The created NC creationprogram includes machining units and machining programs corresponding torespective machining units.

As shown in FIG. 49, a program editing screen 84 has a machining shapetree 80 and a program tree 85, a three-dimensional display section 86,an editor section 87, and a menu display section 91.

The machining shape tree 80 hierarchically displays machining unitnames, as also shown in FIG. 48, in a tree format. The program tree 85hierarchically displays a machining program in a unit of machining unitin a tree format. In the three-dimensional display section 86, any oneof the product model and the workpiece or both (a synthetic modelobtained by overlapping the work model on the product model) isthree-dimensionally displayed by a wire frame or the like.

In the editor section 87, when the machining shape tree 80 is selectedfor display, machining unit data (data including the shape sequenceindicating the machining shape and machining contents) corresponding tothe machining unit name selected in the machining shape tree 80 isdisplayed, and when the program tree 85 is selected for display, amachining program corresponding to the program name (in the case of FIG.54, a program name the same as the machining unit name is provided)selected in the program tree 85 is displayed. In the editor section 87,the cursor is positioned at the top of the machining unit datacorresponding to the machining unit or the machining program, selectedin the machining shape tree 80 or the program tree 85.

First, highlighting display processing of the machining unit in thethree-dimensional display section 86 will be explained with reference toFIG. 50. The processing in FIG. 50 is the highlighting displayprocessing by the program editing processor 18.

It is assumed that one machining unit name is selected in the machiningshape tree 80 to display the machining unit data such as the shapesequence in the editor section 87, or one machining program is selectedin the program tree to display the machining program body in the editorsection 87. The program editing processor 18 detects this (step S220),and highlight-displays a machining unit 89 corresponding to the positionof the cursor 88 in the editor section 87 in the three-dimensionaldisplay section 86 (step S221).

Thus, since the machining unit corresponding to the cursor position ishighlight-displayed in the three-dimensional display section 86, it canbe determined clearly to which machining unit the cursor positioncorresponds, thereby making the edit work efficient, and reducingediting errors.

Insertion processing of the shape sequence constituting the machiningunit data will be explained with reference to FIG. 52. In the shapesequence insertion processing, the shape selected in thethree-dimensional display section 86 can be inserted in the cursorposition in the editor section 87 as the shape sequence. This functionis a convenient function at the time of editing a non-expandable shape.This function is executed in the following manner.

First, the operator selects a machining unit name into which theoperator wants to insert a shape sequence (in this case, it is assumedto be a non-expandable unit) in the program tree 85. The operatorselects the whole shape of the non-expandable unit in the program tree85 or the three-dimensional display section 86. FIG. 51A is a state inwhich the whole non-expandable unit is displayed.

The operator then selects a shape element for which the operator wantsto obtain a coordinate value (for example, one plane) in thethree-dimensional display section 86 by a mouse or the like. Theselected plane 90 is highlight-displayed in the three-dimensionaldisplay section 86, as shown in FIG. 51B.

In this state, after having shifted the cursor position in the editorsection 87 to a desired position, when the operator presses a “shapesequence insertion button” (not shown) in the menu display section 91 onthe program editing screen 84 (step S230), as shown in FIG. 53, a shapesequence corresponding to the selected plane 90 is inserted in thecursor position in the editor section 87 (step S231).

Thus, since the shape selected in the three-dimensional display section86 can be inserted in the cursor position in the editor section 87 as ashape sequence, editing work of the non-expandable shape and the likecan be performed efficiently. In the above explanation, the shapesequence in the machining unit data is inserted in the cursor position,but machining unit data corresponding to the machining unit selected inthe three-dimensional display section 86 can be inserted in the cursorposition.

The insertion processing of the machining program name and the machiningprogram corresponding to the machining unit selected in the machiningshape tree 80 will be explained with reference to FIG. 55. Thisinsertion function can be used when a program for a machining unit isdestroyed due to an erroneous operation, and can perform programconversion in a unit of machining unit. This function is executed in thefollowing manner.

The operator selects a machining unit name to be inserted in themachining shape tree 80 (see FIG. 54). The operator then selects themachining program name next to the position to be inserted (in the caseof FIG. 54, the machining unit name and the machining program name matcheach other) is selected in the program tree 85. At this time, the cursorin the editor section 87 is positioned at the head of the machiningprogram corresponding to the program name selected in the program tree85.

In this state, when the operator presses a “unit insertion button” (notshown) in the menu display section 91 on the program editing screen 84(step S240), the machining program name corresponding to the machiningunit name selected in the machining shape tree 80 is inserted in frontof the machining program name selected in the program tree 85 in a unitof machining unit, and the machining program corresponding to themachining unit name selected in the machining shape tree 80 is insertedin front of the cursor position in the editor section 87 in a unit ofmachining unit.

Thus, since the machining program name and the machining programcorresponding to the machining unit name can be easily inserted in aunit of machining unit, at a desired position in the program tree 85 andthe editor section 87, the editing work can be efficiently performedwhen a machining program for a machining unit is destroyed or the like.A program name next to the position to be inserted is first selected inthe program tree 85, and then a machining unit name to be inserted nextcan be selected in the machining shape tree 80.

SECOND EMBODIMENT

A second embodiment of the present invention will be explained withreference to FIGS. 56 and 57. The automatic programming device in thefirst embodiment is an automatic programming device applied to thetwo-spindle machine tool having two spindles, that is, the main spindleand the sub-spindle installed so as to face the main spindle. However,the automatic programming device in the second embodiment is anautomatic programming device applicable to the two-spindle machine toolhaving the two spindles of the main spindle and the sub-spindle, and aone-spindle machine tool having only the main spindle.

In the case of the two-spindle machine tool, machining in the firstprocess and machining in the second process can be performedcontinuously by the main spindle side and the sub-spindle side.Therefore, in the automatic programming device, one program forcontinuously executing the machining in the first process and themachining in the second process is created. In contrast, in the case ofthe one-spindle machine tool, after finishing machining in the firstprocess, the work is reversed and held again on the main spindle side toperform machining in the second process, in order to perform themachining in the first process and the machining in the second processonly by the main spindle. Therefore, in the automatic programmingdevice, two machining programs, that is, a machining program in thefirst process and a machining program in the second process, arecreated.

In the case of a machine having only the main spindle, without thesub-spindle, after process 1 (corresponding to the first process) isfinished, the work model is reversed and the reversed work model is heldagain by the chuck model of the main spindle, to execute process 2(corresponding to the second process) for performing the machining forthe remaining area. In other words, in the one-spindle machine tool,machining is performed by holding one end of the work model by the firstspindle machine in process 1, and machining is performed by holding theother end of the work model by the first spindle machine in process 2.

As shown in FIG. 56, the automatic programming device in the secondembodiment includes a one-spindle program creating unit 330, which is anautomatic programming device for creating a machining program for aone-spindle machine, a two-spindle program creating unit 331, which isan automatic programming device for creating a machining program for atwo-spindle machine, and a determination unit 340 that determines whichis the control object, of the two-spindle machine or the one-spindlemachine, and activates either the one-spindle program creating unit 330or the two-spindle program creating unit 331 according to thedetermination result.

The operation of the automatic programming device in the secondembodiment will be explained with reference to the flowchart in FIG. 57.The automatic programming device has the determination unit 340 thatdetermines whether the machine tool to be controlled has a sub-spindle,and the determination unit 340 determines, at the time of startup of theprogram, whether the machine tool to be controlled is a machine with asub-spindle (second spindle) (step S400). That is, when the automaticprogramming device is started for the first time, the operator registerswhether the machine tool to be controlled has a sub-spindle, in aninteractive mode using an appropriate dialog, and the registeredidentification information indicating the presence of the sub-spindle isstored, so that the determination unit 340 refers to the storedidentification information at the time of startup of the program, todetermine whether the machine tool to be controlled has the sub-spindle.The automatic programming device also has a function capable of changingthe registered identification information.

Thus, the automatic programming device is first software (two-spindleprogram creating unit 331) for creating an NC creation program forcreating an NC program for machining a product from a work, for thetwo-spindle machine tool having two spindles of the main spindle and thesub-spindle as a control object, and second software (one-spindleprogram creating unit 330) for creating an NC creation program forcreating an NC program for machining a product from a work, for theone-spindle machine tool having the main spindle as a control object. Atthe time of startup of the program, the determination unit 340determines which machine tool is to be controlled, of the one-spindlemachine tool and the two-spindle machine tool, so as to start either thefirst software or the second software. The first software and the secondsoftware include many common parts.

When the determination unit 340 determines that a machine with thesub-spindle is to be controlled, as in the first embodiment, processingat steps S100 to S109 is executed by the first software (see FIG. 2).According to such processing, since the first process and the secondprocess are program-expanded simultaneously at steps S107 and S108, thecreated NC creation program is one continuous program including thefirst process program, the work delivery program, and the second processprogram, and capable of automatically operating the whole process. Inthis case, the program for the second process is created, succeeding theinformation in the first process. Therefore, in the second process, theproduct shape input processing at step S100 and the work type settingprocessing at step S101 can be omitted, thereby enabling efficientprogram creation.

On the other hand, when the determination unit 340 determines that aone-spindle machine tool without having a sub-spindle is to becontrolled, the following processing is performed by the secondsoftware. At first, the product shape input processing similar to thatof step S100 is performed (step S401), the work type setting processingsimilar to that of step S101 is performed (step S402), then aresubsequently performed first process (process 1) jig setting processingsimilar to that of step S102 (step S403), position adjustment processingsimilar to that of step S103 (step S404), and process dividingprocessing similar to that of step S104 (step S405).

When the one-spindle machine tool is to be controlled, process expansionand tool selection for only process 1 are executed (step S406). Programexpansion for only process 1 is then executed (step S407). The workmodel is then reversed by 180 degrees, and held again by the chuck modelof the main spindle (step S408).

Second process (process 2) jig setting processing similar to that ofstep S105 (step S409), and position adjustment processing similar tothat of step S106 (step S410) are performed.

Process expansion and tool selection for only process 2 are executed(step S411), and program expansion for only process 2 is executed (stepS412). The NC creation program including the process 1 program and theprocess 2 program is created in this manner.

According to the second embodiment, it is determined whether the machinetool to be controlled has a sub-spindle, and either the automaticprogramming device for one-spindle machine or the automatic programmingdevice for two-spindle machine is operated according to thedetermination. As a result, an automatic programming device applicableto the two-spindle machine tool having the main spindle and thesub-spindle, and the one-spindle machine tool having only the mainspindle can be provided.

INDUSTRIAL APPLICABILITY

The automatic programming method and device according to the presentinvention is useful for software for creating an NC creation program forcreating an NC program of an NC unit, for a two-spindle machine toolhaving the main spindle and the sub-spindle, or a one-spindle machinetool having only the main spindle as a control object.

1. An automatic programming method of positioning a product model in awork model, and determining a machining area based on a state ofpositioning the product model, the automatic programming methodcomprising: a first processing including: detecting a turning surfacehaving a largest diameter in the product model; and determining acentral axis of rotation on the turning surface detected as a turningaxis of the product model; a second processing including shifting orrotating the product model so that the turning axis of the product modeldetermined matches a turning axis of the work model; and a thirdprocessing including shifting the product model so that an end face ofthe product model shifted at the second processing matches a programorigin preset in the work model.
 2. The automatic programming methodaccording to claim 1, further comprising a fourth processing includingreversing a direction of the product model by 180 degrees with a centralposition of the product model in a direction of the turning axis as acenter.
 3. The automatic programming method according to claim 1,wherein when a part of the turning surface is missing, the firstprocessing further includes setting a distance from the central axis ofrotation to the farthest point as a diameter of the turning surface. 4.The automatic programming method according to claim 1, wherein theproduct model is displayed in a state held by a jig model.
 5. Theautomatic programming method according to claim 1, wherein the productmodel is a model of a resulting product created by machining a workpieceand wherein the work model is a model of the workpiece from which theresulting product is created.
 6. The automatic programming methodaccording to claim 5, wherein a numeric control program is created basedon an automatic overlapping of the product model onto the work model,wherein in said automatic overlapping, the turning axis of the productmodel is automatically matched to the turning axis of the work model inthe second processing and the end face of the product model isautomatically matched to the program origin in the work model in thethird processing.
 7. The automatic programming method according to claim1, wherein the product model is displayed overlapped on the work model.8. The automatic programming method according to claim 1, furthercomprising automatically determining a smallest work model suitable forthe product model.
 9. The automatic programming method according toclaim 1, further comprising selecting at least one claw holding the workmodel, said selection is based on a shape of the work model.
 10. Acomputer-readable recording medium that stores a computer program forpositioning a product model in a work model, and determining a machiningarea based on a state of positioning the product model, wherein thecomputer program makes a computer execute a first processing includingdetecting a turning surface having a largest diameter in the productmodel; and determining a central axis of rotation on the turning surfacedetected as a turning axis of the product model; a second processingincluding shifting or rotating the product model so that the turningaxis of the product model determined matches a turning axis of the workmodel; and a third processing including shifting the product model sothat an end face of the product model shifted at the second processingmatches a program origin preset in the work model.
 11. Thecomputer-readable recording medium according to claim 10, wherein thecomputer program further makes the computer execute a fourth processingincluding reversing a direction of the product model by 180 degrees witha central position of the product model in a direction of the turningaxis as a center.
 12. The computer-readable recording medium accordingto claim 10, wherein when a part of the turning surface is missing, thefirst processing further includes setting a distance from the centralaxis of rotation to the farthest point as a diameter of the turningsurface.
 13. The computer-readable recording medium according to claim10, wherein the product model is displayed in a state held by a jigmodel.
 14. An automatic programming device that positions a productmodel in a work model, and determines a machining area based on a stateof positioning the product model, the automatic programming devicecomprising: a first unit that detects a turning surface having a largestdiameter in the product model, and determines a central axis of rotationon the turning surface detected as a turning axis of the product model;a second unit that shifts or rotates the product model so that theturning axis of the product model determined matches a turning axis ofthe work model; and a third unit that shifts the product model so thatan end face of the product model shifted by the second unit matches aprogram origin preset in the work model.
 15. The automatic programmingdevice according to claim 14, further comprising a fourth unit thatreverses a direction of the product model by 180 degrees with a centralposition of the product model in a direction of the turning axis as acenter.
 16. The automatic programming device according to claim 14,wherein when a part of the turning surface is missing, the first unitsets a distance from the central axis of rotation to the farthest pointas a diameter of the turning surface.
 17. The automatic programmingdevice according to claim 14, wherein the product model is displayed ina state held by a jig model.